package com.yswy.domain.vo.dto;

import java.io.Serializable;

/**
 * 过滤基类
 *
 * @author 周林
 * @version 1.0
 */
public class BaseFilter implements Serializable {
    static final Integer DEFAULT_PAGE_INDEX = 1;
    static final Integer DEFAULT_PAGE_SIZE = 10;

    /** 当前页码，默认第一页  */
    private Integer pageNum;
    /** 每页显示条数， 默认10条  */
    private Integer pageSize;

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageNum() {
        this.pageNum = (pageNum == null || pageNum < 1) ? DEFAULT_PAGE_INDEX : pageNum;
        return pageNum;
    }

    public Integer getPageSize() {
        this.pageSize = (pageSize == null || pageSize < 1) ? DEFAULT_PAGE_SIZE : pageSize;
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }
}
